package co.fitstart.entity.course.round;

public enum OnlineRoundGroupStatus {
    
    DISALLOW_GROUP("disallow_group", "不可分组"),
    
    GROUPING("grouping", "可分组"),
    
    GROUPED("grouped", "已分组"),
    
    UNGROUPED("ungrouped", "未分组");
    
    private String alias;
    
    private String description;
    
    /**
     * 
     * @param alias
     * @param description
     */
     OnlineRoundGroupStatus(String description, String alias) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static OnlineRoundGroupStatus aliasOf(String alias) {
        for (OnlineRoundGroupStatus onlineRoundGroupStatus : OnlineRoundGroupStatus.values()) {
            if (onlineRoundGroupStatus.getAlias().equalsIgnoreCase(alias)) {
                return onlineRoundGroupStatus;
            }
        }
        
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isDisallowGroup() {
        return this.equals(DISALLOW_GROUP);
    }
    
    /**
     * 
     * @return
     */
    public boolean isGrouping() {
        return this.equals(GROUPING);
    }
    
    /**
     * 
     * @return
     */
    public boolean isGrouped() {
        return this.equals(GROUPED);
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

}
